package com.sumer.psychology.common.test;

import com.sumer.psychology.common.persistence.mongodb.MongoApplication;
import org.junit.After;

/**
 * 用于测试的mongo case
 * <p/>
 * Created by twer on 15/8/27.
 */
public class MongoTestCase {
    public static final String DB_NAME = "sumer";
    private TestedMongoApplication mongoApplication;

    public MongoTestCase() {
        mongoApplication = new TestedMongoApplication(DB_NAME);
    }

    @After
    public void tearDown() {
        mongoApplication.client().close();
        mongoApplication.server().shutdownNow();
    }

    public MongoApplication mongoApplication() {
        return mongoApplication;
    }
}
